-- card: 16715 from stack: in.2r -- bmap block id: 0 -- flags: 4000 -- background id: 2202 -- name: VolumeName ----- HyperTalk script ----- function VolumeName path put empty into vol repeat with i = 1 to the length of path if character i of path is ":" then -- Stop at first colon put ":" after vol return vol else put character i of path after vol end if end repeat answer "Bad path given to VolumeName" with "OK" return empty end VolumeName -- part contents for background part 10 ----- text ----- 5 -- part contents for background part 2 ----- text ----- -- -- VolumeName -- given a file pathname, return the name of the volume -- it resides on. Straightforward string munging. -- function VolumeName path put empty into vol repeat with i = 1 to the length of path if character i of path is ":" then -- Stop at first colon put ":" after vol return vol else put character i of path after vol end if end repeat -- If we reach here, there's something drastically wrong. answer "Bad path given to VolumeName" with "OK" return empty end VolumeName -- part contents for background part 3 ----- text ----- VolumeName